package edu.unf.cen6940.converter;

import java.text.ParseException;
import java.util.Locale;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.Formatter;
import org.springframework.stereotype.Component;

import edu.unf.cen6940.dao.ThesistoolDAO;
import edu.unf.cen6940.domain.Thesistool;

@Component
public class ThesistoolConverter implements Formatter<Thesistool>{
	@Autowired
	ThesistoolDAO thesistoolDAO;

	@Override
	public String print(Thesistool arg0, Locale arg1) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Thesistool parse(String arg0, Locale arg1) throws ParseException {
		
		return thesistoolDAO.findThesistoolByThesisToolId(Integer.parseInt(arg0));
	}

}
